import requests
from lxml import etree

if __name__ == '__main__':
    url = 'https://www.baidu.com/s?wd=ip'
    headers = {
            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36'
    }
    page_text = requests.get(url=url, headers=headers, proxies={"HTTPs":"222.110.147.50:3128"}).text

    with open('ip.html', 'w', encoding='utf-8') as fp:
        fp.write(page_text)
